// .txt

beginzonescript;

variables;

short im_hostile = 0;
short last_abil;
short counter = 0;
short set_ter1 = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	if (gf(30,11) == 0) {
		sf(30,4,0);
		sf(30,5,0);
		sf(30,12,0);
		}
	set_name(3022,"Medet");
	set_name(3023,"Medet");
	set_name(3024,"Erud Alsof");
	set_name(3025,"Erud Bota");
	set_name(3026,"Erud Zukhra");
	set_name(3027,"Fauske");
	set_name(3029,"Erud Gulsim");
	set_name(3030,"Erud Nurbik");
	place_particle_num(3030,1075,12,8);
	place_particle_num(3030,1075,13,8);
	set_name(3032,"Erud Fa'alis");
	set_name(30005,"Erudico Guard");
	set_name(30006,"Erud Researcher");
	set_name(30007,"Traveling Merchant");

	set_name(3054,"Raasa Elha");
	if (gf(30,10) > 0)
		erase_char(3054);
		
//	set_attack_range(,);

//	add_ability(short which_char_or_group,short which_slot,short which_ability,0);

//	if (is_town_clear(ME))
//		clean_up_town();

	if (gf(30,29) == 8)
		sf(30,29,9);
		
	// open laskara door, for fun!
	sf(10,21,1);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	//if ((set_ter1 == 0) && (gf(0,0) > 0)) {
	//	set_ter1 = 1;
	//	set_terrain(,,,);
	//	}
	if ((gf(30,20) > 0) && (get_terrain(1,50,23) != 0))
		set_terrain(1,50,23,0);
	if ((gf(30,22) > 0) && (char_ok(3022)))
		erase_char(3022);
			
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3022,"Welcome, Haven.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3022,"We expected you.");
	if (get_ran(1,0,100) < 20)
		give_char_text_bubble(3022,"I can guide you.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3023,"You opened the gate.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3023,"We are grateful.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3023,"Your passage is free.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3024,"The Erudico is fading.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3024,"We are cut off.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3024,"Haven won't send knowledge.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3024,"Go where you wish.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3024,"So many lost towers.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3025,"Control your flames.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3025,"Keep your hands clean.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3025,"This is our library.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3025,"The mind of the Ro.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3026,"What was I saying?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3026,"Yes ... What?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3026,"I perfected the pedestal.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3026,"I can help you craft.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3026,"The Erudico's finest work.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3027,"Yawn.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3027,"I'm up all hours.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3027,"Food? Drink?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3027,"I keep the Eruds alive.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3029,"(Hum. Hum.)");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3029,"(Sway. Sway.)");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3029,"Hmmmm.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3029,"(Click click.)");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3030,"(Smolder.)");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3030,"Mind the flames.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3030,"Such a bother.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3032,"Who were you?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3032,"You will speak with me.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3032,"Can you help me?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(3032,"Meet my gaze.");


	//if (gf(,) < 2) {
	//	inc_flag(,,1);
	//	if (gf(,) == 2)
	//		begin_talk_mode();
	//	}

	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_town()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	}
break;

beginstate 10;
	if (gf(30,12) == 0) {
		sf(30,12,1);
		activate_hidden_group(1);
		set_strategy(3006,2);
		set_strategy(3007,2);
		}
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
